home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / sddparam.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.2 KB  |  73 lines

  1. /* Copyright (C) 1998, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: sddparam.c,v 1.2 2000/09/19 19:00:49 lpd Exp $ */
  20. /* DCTDecode filter parameter setting and reading */
  21. #include "std.h"
  22. #include "jpeglib_.h"
  23. #include "gserror.h"
  24. #include "gserrors.h"
  25. #include "gstypes.h"
  26. #include "gsmemory.h"
  27. #include "gsparam.h"
  28. #include "strimpl.h"        /* sdct.h requires this */
  29. #include "sdct.h"
  30. #include "sdcparam.h"
  31. #include "sjpeg.h"
  32.  
  33. /* ================ Get parameters ================ */
  34.  
  35. stream_state_proc_get_params(s_DCTD_get_params, stream_DCT_state);    /* check */
  36.  
  37. int
  38. s_DCTD_get_params(gs_param_list * plist, const stream_DCT_state * ss, bool all)
  39. {
  40.     stream_DCT_state dcts_defaults;
  41.     const stream_DCT_state *defaults;
  42.  
  43.     if (all)
  44.     defaults = 0;
  45.     else {
  46.     (*s_DCTE_template.set_defaults) ((stream_state *) & dcts_defaults);
  47.     defaults = &dcts_defaults;
  48.     }
  49. /****** NYI ******/
  50.     return s_DCT_get_params(plist, ss, defaults);
  51. }
  52.  
  53. /* ================ Put parameters ================ */
  54.  
  55. stream_state_proc_put_params(s_DCTD_put_params, stream_DCT_state);    /* check */
  56.  
  57. int
  58. s_DCTD_put_params(gs_param_list * plist, stream_DCT_state * pdct)
  59. {
  60.     int code;
  61.  
  62.     if ((code = s_DCT_put_params(plist, pdct)) < 0 ||
  63.     /*
  64.      * DCTDecode accepts quantization and huffman tables
  65.      * in case these tables have been omitted from the datastream.
  66.      */
  67.     (code = s_DCT_put_huffman_tables(plist, pdct, false)) < 0 ||
  68.     (code = s_DCT_put_quantization_tables(plist, pdct, false)) < 0
  69.     )
  70.     DO_NOTHING;
  71.     return code;
  72. }
  73.